Skip to content

Conversation

@Aditya-PS-05
Copy link
Contributor

@Aditya-PS-05 Aditya-PS-05 commented Dec 22, 2025

fixes #150263

Fixes two related ICEs (SignatureMismatch in trait selection and error at backend-ref layouts after projection) that occur in release builds with strict MIR inlining.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 22, 2025

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@Kivooeo
Copy link
Member

Kivooeo commented Dec 22, 2025

Can you please add a regression test for this

@rust-log-analyzer

This comment has been minimized.

@Aditya-PS-05 Aditya-PS-05 force-pushed the fix-ice-signature-issue-and-mir-layout branch from 9df93f6 to 46a2d99 Compare December 22, 2025 22:07
@Aditya-PS-05
Copy link
Contributor Author

Can you please add a regression test for this

Right now, tests don't create real ICEs as it's being complex to write such test. But I have wrote two test files who documents the issue.

@Kivooeo
Copy link
Member

Kivooeo commented Dec 22, 2025

Ah, there is no MCVE... Honestly, I'm not sure if just removing debug_asserts is enough to fix this. Have you found a root cause of this issue or something?

@cjgillot
Copy link
Contributor

This is the wrong way to approach this. MIR inlining is an optimization, so it's optional. Those debug-assertions ensure that we can reason about what codegen does, which helps soundness, so it's mandatory.

Could you investigate disabling instances of MIR inlining that would trigger this bug?

@Aditya-PS-05
Copy link
Contributor Author

Aditya-PS-05 commented Dec 23, 2025

Ah, there is no MCVE... Honestly, I'm not sure if just removing debug_asserts is enough to fix this. Have you found a root cause of this issue or something?

With complex type projections like <Child<'c, S, T> as MaybeTotalScope>::MaybeTotalTimestamp , the compiler needs to normalize this to S::MaybeTotalTimestamp but during aggressive inlining, the type normalization happens during codegen (late in compilation) and then normalization fails → SignatureMismatch error and then ICE occurs.

Could you investigate disabling instances of MIR inlining that would trigger this bug?

It will return Unimplemented that prevents MIR inlining - when codegen can't resolve the instance, the inliner skips it.

When local is backend-ref (too big), we must use Memory. Earlier it assumed this never happens after field projection, but it can with multi-variant enums, so here second ice occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE in release builds from 1.90.0 onwards

6 participants